package com.le.tester.javaThink.fifth.chapter24_ConcurrentProgramming;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * createTime：2021/8/17 16:34
 * description：IntStream.range()生成int流
 */
public class ParallelStreamPuzzle3 {
    public static void main(String[] args) {
        List<Integer> x = IntStream.range(0, 30)
                .peek(e -> System.out.println(e + ": " + Thread.currentThread().getName()))
                .limit(10)
                .parallel()
                //装箱操作
                .boxed()
                .collect(Collectors.toList());
        System.out.println(x);
    }
}
